<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/index_v3.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:18:46 GMT -->
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>报表</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/admin/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/admin/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">

    <!-- Morris -->
    <link href="/admin/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">

    <!-- Gritter -->
    <link href="/admin/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">

    <link href="/admin/css/animate.min.css" rel="stylesheet">
    <link href="/admin/css/style.min862f.css?v=4.1.0" rel="stylesheet">

</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-success pull-right">今日</span>
                        <h5>会员</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">${todayUser}</h1>
                        <div class="stat-percent font-bold text-success">${sumUser} </i>
                        </div>
                        <small>总会员</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-info pull-right">今日</span>
                        <h5>订单</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">${todayOrder}</h1>
                        <div class="stat-percent font-bold text-info">${sumOrder}</i>
                        </div>
                        <small>总订单</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-primary pull-right">今日</span>
                        <h5>收入</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">${todayProfit}</h1>
                        <div class="stat-percent font-bold text-navy">${sumProfit}</i>
                        </div>
                        <small>总收入</small>
                    </div>
                </div>
            </div>
            <div class="col-sm-3">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <span class="label label-danger pull-right">预约</span>
                        <h5>总预约</h5>
                    </div>
                    <div class="ibox-content">
                        <h1 class="no-margins">${sumSecurity}</h1>
                        <div class="stat-percent font-bold text-danger">${sumSurplusMoney}
                        </div>
                        <small>用户余额</small>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>折线图</h5>
                        <div class="pull-right">
                            <form class="form-inline">
                                <div class="form-group" style="margin-top: -15px">
                                    <input name="filterStartValue" type="text" class="form-control input-sm" id="start" placeholder="开始日期">
                                </div>
                                <div class="form-group" style="margin-top: -15px">
                                    <input   name="filterEndValue" type="" class="form-control  input-sm" id="end" placeholder="结束日期">
                                </div>
                                <button style="margin-top: -10px" id="query" class="btn btn-primary btn-sm"  type="button">查询</button>
                            </form>

                        </div>
                    </div>
                    <div class="ibox-content">

                        <div class="row">
                            <div class="col-sm-12">

                                <div id="container" style="min-width:400px;height:400px"></div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
        <script src="/admin/frame/jquery/jquery-1.9.1.min.js"></script>
        <script src="/admin/frame/bootstrap/js/bootstrap.min.js"></script>
        <script src="/admin/frame/bootstrap-table/bootstrap-table.min.js"></script>
        <script src="/admin/frame/bootstrap-table/bootstrap-table-mobile.min.js"></script>
        <script src="/admin/frame/highcharts5/code/highcharts.js"></script>
        <script src="/admin/frame/bootstrap/js/bootstrap.min.js"></script>
        <script src="/admin/js/content.min.js?v=1.0.0"></script>
        <script src="/admin/frame/layer/laydate/laydate.js"></script>
    <script src="/admin/frame/layer/layer.js"></script>
        <script src="/admin/js/myPlug.js"></script>
        <script src="/admin/js/init.js"></script>
        <script>
           $(function () {
                   dateAssemblyInit();
                   var data=getData({});
                  loadStatistics(data);
                  $("#query").on("click",function () {
                      var par={};
                          par.startValue=$("#start").val();
                          par.endValue=$("#end").val();
                          if(par.startValue==null||par.startValue=="")
                          {
                              layer.msg("请填写完整日期");
                              return;
                          }
                          if(par.endValue==null||par.endValue=="")
                          {
                              layer.msg("请填写完整日期");
                              return;
                          }
                      var data=getData(par)
                      loadStatistics(data);
                  })
           })
            function loadStatistics(data) {
                var chart = new Highcharts.Chart('container', {
                    title: {
                        text: data.title,
                        x: -20
                    },
                    subtitle: {
                        text: '数据来源: 亚细亚销售系统',
                        x: -20
                    },
                    xAxis: {
                        categories: data.categories
                    },
                    yAxis: {
                        title: {
                            text: ''
                        },
                        plotLines: [{
                            value: 0,
                            width: 1,
                            color: '#808080'
                        }]
                    },
                    tooltip: {
                        valueSuffix: ''
                    },
                    legend: {
                        layout: 'vertical',
                        align: 'right',
                        verticalAlign: 'middle',
                        borderWidth: 0
                    },
                    series: data.list
                });
            }

            function getData(data) {
                var msgdata={}
                var aj=$.ajax({
                    url:'/Admin/Statistics/statisticsEntity',
                    type:'post',
                    dataType:'json',
                    data:data,
                    async: false,
                    success:function(msg){
                        msgdata=msg;
                    }
                })
                return msgdata;
            }

            function dateAssemblyInit() {
                var start = {
                    elem: "#start",
                    format: "YYYY/MM/DD",
                    min: "2017-01-01 00:00:01",
                    max: laydate.now(),
                    istime: false,
                    istoday: false,
                    choose: function(datas) {
                        end.min = datas;
                        end.start = datas
                    }
                };
                var end = {
                    elem: "#end",
                    format: "YYYY/MM/DD",
                    min: "2017-01-01 00:00:01",
                    max: laydate.now(),
                    istime: false,
                    istoday: false,
                    choose: function(datas) {
                        start.max = datas
                    }
                };
                laydate(start);
                laydate(end);
            }
        </script>
</body>
</html>

